import { observable , action , computed } from 'mobx';

class Globals {
    @observable
    protected author: string = "rosiky9527";

    @observable
    protected src: string = '';

    @observable
    protected first: boolean = true;

    @action
    protected setAuthor = (author: string): void => {
        this.author = author;
    }

    @action
    protected setSrc = (src: string): void => {
        this.src = src;
    }

    @action
    protected setFirst = (mark: boolean): void => {
        this.first = mark;
    }

    @computed
    protected get formatAuthor(): string {
        return `${this.author}: ${new Date()}`;
    }
}

export const Global = new Globals();